package com.zbxx.practice.designpattern.proxy.staticproxy;

import com.zbxx.practice.designpattern.proxy.BusinessService;

/**
 * @author 万仁杰
 * @date 2019/05/31
 */
public class BusinessProxyObject implements BusinessService {

    private BusinessService proxyObject;

    private BusinessProxyObject(BusinessService proxyObject){
        this.proxyObject = proxyObject;
    }

    public static BusinessProxyObject createStaticProxyInstance(BusinessService proxyObject){
        return new BusinessProxyObject( proxyObject);
    }

    @Override
    public void doService() {
        System.out.println("static proxy object start");
        proxyObject.doService();
        System.out.println("static proxy object end");
    }
}
